package com.qf.springboot.services.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.springboot.dao.EmpMapper;
import com.qf.springboot.entity.Emp;
import com.qf.springboot.services.EmpServices;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author: COS
 * @time: 2021/12/1 14:44
 * @description:
 */
@Service
public class EmpServicesImpl implements EmpServices {
    @Resource
    private EmpMapper empMapper;
    @Override
    public List<Emp> getAll() {
        return empMapper.getAll();
    }

    @Override
    public PageInfo getAllByPage(int page,int limit){
        PageHelper.startPage(page, limit);
        List<Emp> all = empMapper.getAll();
        PageInfo<Emp> pi = new PageInfo<>(all);
        return pi;
    }
}
